<template>
  <div class="child2">
    <h3>子组件2</h3>
		<h4>我的游戏数量：{{gameNum}}</h4>
    <h4>我的书籍数量：{{bookNum}}</h4>
		<button @click="test">干掉父亲一套房</button>
  </div>
</template>

<script>

export default {
  name: 'Child1',
	data() {
		return {
			gameNum:500,
      bookNum:1
		}
	},
	methods: {
    test(){
      this.$parent.houseNum -= 1
    }
  },
}
</script>

<style lang="less" scoped>
	.child2{
		margin-top: 20px;
		background-color: skyblue;
		padding: 20px;
		border-radius: 10px;
    box-shadow: 0 0 10px black;
	}
</style>
